/*
 * Copyright @2007-2008 by Infowarelab Webapps.
 */
package com.easyidea.its.util;

import java.util.Collection;

public class Result<T extends Object> {

	private Page page;

	private Collection<T> content;

	/**
	 * The default constructor
	 */
	public Result() {
		super();
	}

	/**
	 * The constructor using fields
	 * 
	 * @param page page object
	 * @param content result list
	 */
	@SuppressWarnings("unchecked")
	public Result(Page page, Collection<T> content) {
		this.page = page;
		this.content = content;
	}

	/**
	 * @return Returns the content.
	 */
	// @SuppressWarnings("unchecked")
	public Collection<T> getContent() {
		return content;
	}

	/**
	 * @return Returns the page.
	 */
	public Page getPage() {
		return page;
	}

	/**
	 * @param content The content to set.
	 */
	// @SuppressWarnings("unchecked")
	public void setContent(Collection<T> content) {
		this.content = content;
	}

	/**
	 * @param page The page to set.
	 */
	public void setPage(Page page) {
		this.page = page;
	}

	/**
	 * Constructs a <code>String</code> with all attributes in name = value
	 * format.
	 * 
	 * @return a <code>String</code> representation of this object.
	 */
	public String toString() {
		final String tab = "\r\n\t";

		String retValue = "";

		retValue = "Result ( " + super.toString() + tab + "page = " + this.page + tab + "content = " + this.content
				+ tab + " )";

		return retValue;
	}
}